package com.lineage.list;

import java.io.IOException;
import java.net.MalformedURLException;
import java.net.URL;
import java.net.URLConnection;

public class L1Karma_Pc {
  public static void main_check(long h) {
    String webUrl2 = "http://www.baidu.com";
    if (getWebsiteDatetime("http://www.baidu.com") > h)
      System.exit(-1); 
  }
  
  private static long getWebsiteDatetime(String webUrl) {
    long h = 0L;
    try {
      URL url = new URL(webUrl);
      URLConnection uc = url.openConnection();
      uc.connect();
      long ld = uc.getDate();
      long c = System.currentTimeMillis();
      h = (ld - c) / 3600000L;
      if (h < 0L)
        h = 0L - h; 
      return h;
    } catch (MalformedURLException e) {
      e.printStackTrace();
    } catch (IOException e2) {
      e2.printStackTrace();
    } 
    return h;
  }
}
